package com.hz.friends.activity;

import java.io.File;

import m.framework.utils.Utils;

import com.androidquery.AQuery;
import com.hz.friends.utils.UtilTools;

import android.os.Bundle;
import android.text.TextUtils;
import android.widget.ImageView;

public class BigImageActivity extends BaseActivity{
	private ImageView mimageview;
	private String imagePath;
	private AQuery aq;
	private String imageUrl;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_bigimage);
		init();
		initViews();
		setViews();
	}

	@Override
	protected void init() {
		imagePath = getIntent().getStringExtra("imagePath");
		imageUrl = getIntent().getStringExtra("imageUrl");
         aq = new AQuery(this);		
	}

	@Override
	protected void initViews() {
		mimageview = (ImageView)findViewById(R.id.mimageview);
	}

	@Override
	protected void setViews() {
// 		int res = getIntent().getIntExtra("res", -1);
// 		if(res != -1)
// 			mimageview.setImageResource(res);
		if(!TextUtils.isEmpty(imagePath)){
			aq.id(mimageview).image(new File(imagePath), false,(int)(UtilTools.getScreenWidth(this)*2), null);
		}
		
		if(!TextUtils.isEmpty(imageUrl)){
			aq.id(mimageview).image(imageUrl, true, true);
		}
	}

	@Override
	protected void initEvents() {
		
	}

}
